package com.teampower.idea.action;

import java.io.IOException;

import com.teampower.idea.base.BaseAction;

public class AritcalListAction extends BaseAction{

	/**
	 * 读取新闻列表
	 */
	protected String classId;
	public String getClassId() {
		return classId;
	}
	public void setClassId(String classId) {
		this.classId = classId;
	}
	public void getAritcalList() throws IOException{
		
		if("hot".equals(getClassId())){
			setJson("{total:10,list:[" +
					"{title:'热帖0',href:'getArtical?id=0'}," +
					"{title:'热帖1',href:'getArtical?id=1'}," +
					"{title:'热帖2',href:'getArtical?id=2'}," +
					"{title:'热帖3',href:'getArtical?id=3'}," +
					"{title:'热帖4',href:'getArtical?id=4'}," +
					"{title:'热帖5',href:'getArtical?id=5'}," +
					"{title:'热帖6',href:'getArtical?id=6'}," +
					"{title:'热帖7',href:'getArtical?id=7'}," +
					"{title:'热帖8',href:'getArtical?id=8'}," +
					"{title:'热帖9',href:'getArtical?id=9'}" +
					"]}");
		}else if("news".equals(getClassId())){
			setJson("{total:10,list:[" +
					"{title:'新闻0',href:'getArtical?id=0'}," +
					"{title:'新闻1',href:'getArtical?id=1'}," +
					"{title:'新闻2',href:'getArtical?id=2'}," +
					"{title:'新闻3',href:'getArtical?id=3'}," +
					"{title:'新闻4',href:'getArtical?id=4'}," +
					"{title:'新闻5',href:'getArtical?id=5'}," +
					"{title:'新闻6',href:'getArtical?id=6'}," +
					"{title:'新闻7',href:'getArtical?id=7'}," +
					"{title:'新闻8',href:'getArtical?id=8'}," +
					"{title:'新闻9',href:'getArtical?id=9'}" +
					"]}");
		}else if("blog".equals(getClassId())){
			setJson("{total:10,list:[" +
					"{title:'博客0',href:'getArtical?id=0'}," +
					"{title:'博客1',href:'getArtical?id=1'}," +
					"{title:'博客2',href:'getArtical?id=2'}," +
					"{title:'博客3',href:'getArtical?id=3'}," +
					"{title:'博客4',href:'getArtical?id=4'}," +
					"{title:'博客5',href:'getArtical?id=5'}," +
					"{title:'博客6',href:'getArtical?id=6'}," +
					"{title:'博客7',href:'getArtical?id=7'}," +
					"{title:'博客8',href:'getArtical?id=8'}," +
					"{title:'博客9',href:'getArtical?id=9'}" +
					"]}");
		}else if("bbs".equals(getClassId())){
			setJson("{total:10,list:[" +
					"{title:'论坛0',href:'getArtical?id=0'}," +
					"{title:'论坛1',href:'getArtical?id=1'}," +
					"{title:'论坛2',href:'getArtical?id=2'}," +
					"{title:'论坛3',href:'getArtical?id=3'}," +
					"{title:'论坛4',href:'getArtical?id=4'}," +
					"{title:'论坛5',href:'getArtical?id=5'}," +
					"{title:'论坛6',href:'getArtical?id=6'}," +
					"{title:'论坛7',href:'getArtical?id=7'}," +
					"{title:'论坛8',href:'getArtical?id=8'}," +
					"{title:'论坛9',href:'getArtical?id=9'}" +
					"]}");
		}else if("book".equals(getClassId())){
			setJson("{total:10,list:[" +
					"{title:'图书0',href:'getArtical?id=0'}," +
					"{title:'图书1',href:'getArtical?id=1'}," +
					"{title:'图书2',href:'getArtical?id=2'}," +
					"{title:'图书3',href:'getArtical?id=3'}," +
					"{title:'图书4',href:'getArtical?id=4'}," +
					"{title:'图书5',href:'getArtical?id=5'}," +
					"{title:'图书6',href:'getArtical?id=6'}," +
					"{title:'图书7',href:'getArtical?id=7'}," +
					"{title:'图书8',href:'getArtical?id=8'}," +
					"{title:'图书9',href:'getArtical?id=9'}" +
					"]}");
		}
		write();
		//System.out.println(getClassId());
	}

}
